var scrollElemh;
var stopscrollh;
var stoptimeh;
var preToph;
var leftElemh;
var currentToph;
var marqueesHeighth;
function marque(width,height,marqueName,marqueCName){
 try{
   marqueesHeighth = height;
   stopscrollh     = false;

   scrollElemh = document.getElementById(marqueName);
   with(scrollElemh){
  		style.width     = width;
  		style.height    = height;
  		style.overflow  = 'hidden';
  		noWrap          = true;
   }

   scrollElemh.onmouseover = new Function('stopscrollh = true');
   scrollElemh.onmouseout  = new Function('stopscrollh = false');

   preToph     = 0;
   currentToph = 0;
   stoptimeh   = 0;

   leftElemh = document.getElementById(marqueCName);
   scrollElemh.appendChild(leftElemh.cloneNode(true));
   
   init_srolltexth();

 }catch(e) {}
}
function init_srolltexth(){
  scrollElemh.scrollTop = 0;
  setInterval('scrollUph()', 10);
}

function scrollUph(){
  if(stopscrollh) return;
  currentToph += 1;
  if(currentToph == marqueesHeighth+1) {
    stoptimeh += 1;
    currentToph -= 1;
    if(stoptimeh == (marqueesHeighth)*4) {//停顿时间
      currentToph = 0;
      stoptimeh = 0;
    }
  }else{

    preToph = scrollElemh.scrollTop;
    scrollElemh.scrollTop += 1;
    if(preToph == scrollElemh.scrollTop){
      scrollElemh.scrollTop = marqueesHeighth;
      scrollElemh.scrollTop += 1;
    }
  }
}